var a = getApp();

Page({
    data: {
        orderId: "",
        baseUrl: a.globalData.baseUrl,
        appurl: "order/orderTuanDetail"
    },
    onLoad: function(t) {
        var e = this;
        e.setData({
            nickName: a.globalData.nickName,
            avatarUrl: a.globalData.avatarUrl,
            orderId: t.id
        });
        var o = a.globalData.urlBase + e.data.appurl;
        this.getinitData(o);
    },
    getinitData: function(t) {
        var e = this;
        wx.request({
            url: t,
            data: {
                orderId: e.data.orderId,
                lng: a.globalData.lng,
                lat: a.globalData.lat
            },
            method: "POST",
            header: {
                "content-type": "application/x-www-form-urlencoded"
            },
            success: function(a) {
                var t = JSON.parse(a.data);
                console.log(t), 0 != t.code ? wx.showToast({
                    title: t.msg,
                    icon: "none",
                    duration: 2e3
                }) : e.setData({
                    order: t.order,
                    store: t.store,
                    good: t.goodsDetailList,
                    tuan: t.tuan
                });
            }
        });
    },
    openMap: function() {
        var a = this;
        wx.openLocation({
            latitude: parseFloat(a.data.store.lat),
            longitude: parseFloat(a.data.store.lng),
            name: a.data.store.name,
            address: a.data.store.address
        });
    },
    onShareAppMessage: function() {}
});